import request from '@/utils/request'
import type { PageParam, ResponseData } from '../commonType'

enum API {
  GET_URL = '/t-vessels-image/selectVesselImg',
  ADD_URL = '/t-vessels-image/add',
  DELETE_URL = '/t-vessels-image/delete',
  BATCH_DELETE_URL = '/t-vessels-image/deleteBatch',
  updateImgIndex_URL = '/t-vessels-image/updateImgIndex',
  updateImgIndexBatch_URL = '/t-vessels-image/updateImgIndexBatch',
}

export function albumGet(data) {
  return request.get<any, ResponseData>(API.GET_URL, { params: data })
}

export function albumAdd(data: any) {
  return request.post<any, ResponseData>(API.ADD_URL, data)
}

export function albumDelete(id: string | number) {
  return request.post<any, ResponseData>(`${API.DELETE_URL}/${id}`)
}

export function albumBatchDelete(data) {
  return request.post<any, ResponseData>(API.BATCH_DELETE_URL, data)
}

export function updateImgIndex(data) {
  return request.post<any, ResponseData>(API.updateImgIndex_URL, data)
}

export function updateImgIndexBatch(data) {
  return request.post<any, ResponseData>(API.updateImgIndexBatch_URL, data)
}
